//
//  BEEmptyTipView.m
//  s.
//
//  Created by fanshijian on 2022/8/24.
//  Copyright © 2022 J. All rights reserved.
//

#import "BEEmptyTipView.h"

@interface BEEmptyTipView ()
{
    NSString *_imageName;
    NSString *_emtpyString;
}

@end

@implementation BEEmptyTipView

- (UIImageView *)imageView{
    if (!_imageView) {
        UIImageView *obj = [[UIImageView alloc] init];
        [self addSubview:_imageView = obj];
        [obj mas_makeConstraints:^(MASConstraintMaker *make) {
            kMakeCenterXV(0);
            kMakeCenterY(self.mas_centerY).offset(-50);
        }];
    }
    return _imageView;
}


- (UILabel *)tipLabel{
    if (!_tipLabel) {
        UILabel *obj = [[UILabel alloc] init];
        obj.font = U_font(14);
        obj.textColor = KLColor(@"#999999");
        [self addSubview:_tipLabel = obj];
        [obj mas_makeConstraints:^(MASConstraintMaker *make) {
            kMakeCenterXV(0);
            kMakeCenterY(self.mas_centerY).offset(20);
        }];
    }
    return _tipLabel;
}


- (void)setupImage:(NSString *)imageName {
    if (_imageName != imageName) {
        _imageName = imageName;
        self.imageView.image = [UIImage imageNamed:_imageName];
    }
}

- (void)setupEmptyString:(NSString *)emtpyString {
    if (_emtpyString != emtpyString) {
        _emtpyString = emtpyString;
        self.tipLabel.text = _emtpyString;
    }
}

@end
